{% extends "base.jinja" %}

{% block title %}{% if search_type =='color' %}{{color_data.name}}{% else %}{{search_key}}{% endif %}_{% endblock %}
{% block keywords %}{% if search_type =='color' %}{{color_data.name}}{% else %}{{search_key}}{% endif %}{% endblock %}
{% block description %}love with me！我的婚礼时光！分享婚礼图片、轻松发现婚礼创意、搜集婚礼素材、分享婚礼过程。点亮自己的灵感，为自己打造一次完美的婚礼。{% endblock %}

{% block css %},main.css{% endblock %}
{% block focussign %}focussign{% endblock %}
{% block pagetype %}search search-{{search_type}}{% endblock %}


{% block main %}
    <div class="page-banner se-head">
        <div class="layout">
            <input type="hidden" id="searchKey" value="{{search_key}}" />
            搜索到<h4>{% if search_type =='color' %}{{color_data.name}}{% else %}{{search_key}}{% endif %}</h4>{{total}}个结果
            {% if search_type == 'tag' and total > 0 %}
            <div class="opt-ps">
                <a class="inp-btn-pk ui-a opt-sub" href="javascript:;" data-act="add" data-key="{{search_key}}" data-require="sign">订阅</a>
                <a class="inp-btn-gray ui-a opt-unsub" href="javascript:;" data-act="del" data-key="{{search_key}}" data-require="sign">取消</a>
            </div>
            {% endif %}
        </div>
    </div>
    
    <div class="layout">
        <div class="mt-crumb">
            <a href="{{domain}}">首页</a>&nbsp;>&nbsp;<b>搜索结果</b>
        </div>

        <div class="share page" id="share">
            {% if share_data %}
            <ul>
                {% for share in share_data %}
                    <li class="s-notitle" data-mid="{{share.cover_id}}" >
                        {% if search_type == 'keyword' %}
                            {% set action = 'share/detail/all/%s/' % share.share_id %}
                        {% else %}
                            {% set action = 'share/detail/all/%s/#m%s' % (share.share_id, share.cover_id) %}
                        {% endif %}
                        <a target="_blank" class="s-link" href="{{domain}}{{action}}" {% if loop.index0 >= 12 and share.background %}style="background:{{share.background}};opacity:0.5;"{% endif %}>
                        {% if loop.index0 < 12 %}
                            <img alt="{{share.title|safe}}" src="{{share.cover}}!260" width="260"/>
                        {% else %}
                            <img alt="{{share.title|safe}}" src="http://s.lovewith.me/static/images/blank.gif" data-src="{{share.cover}}!260" height="200" width="260"/>
                        {% endif %}
                        </a>
                        {% if share.is_video %}
                            <span class="ui ed-video" data-video="{{share.video}}"></span>
                        {% endif %}
                        <div class="s-ext">
                            <p title="{{share.title|forceescape}}"><a target="_blank" href="{{domain}}{{action}}">{{share.title|safe|cut_str(32)}}</a></p>
                            <span class="s-ext-img">{{share.count}}P</span>
                        </div>
                        {% if share.reserve %}
                        <a target="_blank" href="{{domain}}share/detail/all/{{share.share_id}}/#m{{share.cover_id}}" class="ui s-reserve"></a>
                        {% else %}
                            {% if share.sale_data %}
                            <a target="_blank" href="{{domain}}{{action}}" class="ui s-sale"></a>
                            {% endif %}
                        {% endif %}
                    </li>
                {% endfor %}
            </ul>
            <div class="s-more"><a href="javascript:;" data-scroll="1" data-page="1" id="s-more-btn" data-action="/share/ajax/g/share/?{{search_type}}={{search_key}}">更多..</a></div>
            {% endif %}
        </div>
    </div>
{% endblock %}